//
//  stock20.hpp
//  Practice12
//
//  Created by 赵世杰 on 2020/8/15.
//  Copyright © 2020 zhaoshijie. All rights reserved.
//

#ifndef stock20_hpp
#define stock20_hpp

#include <stdio.h>

#endif /* stock20_hpp */

#include <string>

using namespace std;


class Stock
{
    
private:
    
    char *company;
    
    int shares;
    
    double share_val;
    
    double total_val;
    
    void set_tot() {
        
        total_val = shares * share_val;
        
    }
    
public:
    
    Stock();
    
    Stock(const string & co , long n= 0  , double pr = 0);
    
    ~Stock();
    
    void buy(long num , double price);
    
    void sell(long num , double price);
    
    void updata(double price);
    
    void show() const;
    
    const Stock & topval(const Stock & s) const;
    
};
